<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddRepayTypeToRepayRecord extends Migration
{
    protected $table = "repay_records";
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table($this->table, function (Blueprint $table) {
            $table->unsignedTinyInteger('repay_type')->default(1)->comment('1=>app中用户手动点击还款,2=>app中自动还款,3=>代扣,4=>销账,5=>催收方的全部还清');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        if(Schema::hasTable($this->table)){
            Schema::table($this->table, function (Blueprint $table) {
                $table->dropColumn('repay_type');
            });
        }
    }
}
